home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / programs / bug.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-29  |  1.5 KB  |  67 lines

  1.  
  2. #include <Xm/Label.h>
  3. #include <Xm/CSText.h>
  4. #include <Xm/RowColumn.h>
  5.  
  6.  
  7. void
  8. QuitCB(w, client_data, call_data)
  9.     Widget w;
  10.     XtPointer client_data, call_data;
  11. {
  12.     exit(0);
  13. }
  14.  
  15. void
  16. PressedCB(w, client_data, call_data)
  17.     Widget w;
  18.     XtPointer client_data, call_data;
  19. {
  20.     printf("action was: %s\n", (char *) client_data);
  21. }
  22.  
  23. int
  24. main(argc, argv)
  25.     int argc;
  26.     char **argv;
  27. {
  28.     Widget rowcol;
  29.     Widget button;
  30.     XtAppContext app;
  31.     Widget toplevel;
  32.     Widget cstext;
  33.     XmString str1, str2, str3, str4, str5;
  34.     Arg args[10];
  35.     int n = 0;
  36.     XmString *items;
  37.     XmStringCharSet    charSet = XmFONTLIST_DEFAULT_TAG;
  38.  
  39.     toplevel = XtAppInitialize(&app, "XmSend", NULL, 0, &argc, argv,
  40.                 NULL, NULL, 0);
  41.  
  42.     rowcol = XmCreateRowColumn(toplevel, "rowcol", NULL, 0);
  43.     XtManageChild(rowcol);
  44.  
  45.     button = XmCreateLabel(rowcol, "top_button", args, n);
  46.     XtManageChild(button);
  47.  
  48.     cstext = XmCreateCSText(rowcol, "text", args, n);
  49.     XtManageChild(cstext);
  50.  
  51.     str1 = XmStringSegmentCreate("hi there", charSet, 
  52.             XmSTRING_DIRECTION_L_TO_R, True);
  53.     str2 = XmStringDirectionCreate(XmSTRING_DIRECTION_R_TO_L);
  54.     str3 = XmStringConcatAndFree(str1, str2);
  55.  
  56.     str4 = XmStringSegmentCreate("back again", charSet, 
  57.             XmSTRING_DIRECTION_R_TO_L, True);
  58.     str5 = XmStringConcatAndFree(str3, str4);
  59.  
  60.     XtVaSetValues(button, XmNlabelString, str5, NULL);
  61.     XtVaSetValues(cstext, XmNcstextValue, str5, NULL);
  62.  
  63.     XtRealizeWidget(toplevel);
  64.  
  65.     XtAppMainLoop(app);
  66. }
  67.